<?php

/**
 * Historique filter form base class.
 *
 * @package    jobeat
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BaseHistoriqueFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'attrtypeelement' => new sfWidgetFormChoice(array('choices' => array('' => '', 'Fichier' => 'Fichier', 'Dossier' => 'Dossier', 'Projet' => 'Projet'))),
      'attrdate'        => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'attraction'      => new sfWidgetFormChoice(array('choices' => array('' => '', 'Suppression' => 'Suppression', 'Modification' => 'Modification', 'Ajout' => 'Ajout'))),
      'fkelement'       => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'fkutilisateur'   => new sfWidgetFormFilterInput(array('with_empty' => false)),
    ));

    $this->setValidators(array(
      'attrtypeelement' => new sfValidatorChoice(array('required' => false, 'choices' => array('Fichier' => 'Fichier', 'Dossier' => 'Dossier', 'Projet' => 'Projet'))),
      'attrdate'        => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'attraction'      => new sfValidatorChoice(array('required' => false, 'choices' => array('Suppression' => 'Suppression', 'Modification' => 'Modification', 'Ajout' => 'Ajout'))),
      'fkelement'       => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'fkutilisateur'   => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
    ));

    $this->widgetSchema->setNameFormat('historique_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Historique';
  }

  public function getFields()
  {
    return array(
      'id'              => 'Number',
      'attrtypeelement' => 'Enum',
      'attrdate'        => 'Number',
      'attraction'      => 'Enum',
      'fkelement'       => 'Number',
      'fkutilisateur'   => 'Number',
    );
  }
}
